package com.btt.pattern.prototype.simple;

import java.util.ArrayList;
import java.util.List;

/**
 * created by Btt on 2018/6/28
 */

public class CloneTest {

    public static void main(String[] args) {

        Prototype prototype = new Prototype();
        prototype.setName("Btt");
        List<String> list = new ArrayList<>();
        list.add("1");
        prototype.setList(list);

        try {
            Prototype o = (Prototype)prototype.clone();
            System.out.println(o.getList() == prototype.getList());
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        System.out.println();

    }

}
